﻿<%@ page language="C#" masterpagefile="MasterPageFrame.master" autoeventwireup="true" inherits="admin_notepub, App_Web_bgx0xzll" title="Untitled Page" validaterequest="false" %>

<%@ Register Assembly="WebNoteEditor" Namespace="WebNoteEditor" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.btnViewPic{padding-right:30px;text-decoration:none;}
.btnViewPic:hover{color:red}
.viewpic{position:relative;display:none}
.viewpic span{cursor:pointer;background-image:url('css/error.gif');width:16px;height:16px;display:inline-block;position:absolute;top:5px;right:0px;background-repeat:no-repeat;background-position:center center}
#NoteTypeID{width:180px}
/*产品扩展*/


</style>
<script language="javascript">
var upload1,upload2,boundUploadElement;

window.onload=function()
{
	$form.addOption("NoteTypeID","","请选择信息分类");
	if ("<%=Session["flag"]%>"=="3")
	{
		$form.addOptionsByXML("xmlnotetype.aspx","NoteTypeID","notetypeid","notetypename");
	}
	else
	{
		$form.addOptionsByXML("xmlnotetype.aspx?notetypeid=<%=Session["flagstringnote"]%>","NoteTypeID","notetypeid","notetypename");
	}
	
	$("#urlhref").val(unescape(QueryString("urlhref")));
	
    $("#noteid").val(QueryString("noteid"));

    if ($("#noteid").val()!="")
    {
        //window.open("xmlnote.aspx?noteid="+$("#noteid").val());
        $form.ElementsDataFromXML("f1","xmlnote.aspx?noteid="+$("#noteid").val());
        $editor.setHTML(gE("Content").value,true);
    }
    else
    {
	    var _focusNoteTypeID=QueryString("notetetypeid");
	    if (!_focusNoteTypeID)
	    {
		    _focusNoteTypeID=getCookie("NoteTypeID");

	    }
	    $form.focusSelect("NoteTypeID",_focusNoteTypeID);
	    $("#ModifyTime").val("<%=DateTime.Now.ToString() %>");
	}	
	$("#ModifyTime").datepicker({monthNamesShort:['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],changeYear:true,changeMonth:true,dateFormat: 'yy-m-d'});
	document.getElementById("btnSubmit").disabled=false;

	window.focus();
	
    __renderViewPic();
}


function __checkform(event)
{
	if (!jsformcheck(event))
		return false;
	return true;
}
//上传===========================




function __showdialog(_t)
{

	$('#dialogupload').dialog({
		autoOpen: false,
		width: 560,
		resizable:false,
		title:_t,
		modal:true
	});

	$('#dialogupload').dialog('open');
}
            
function uploadSuccess__callback(file,serverData)
{
    eval(serverData);
    if(returnValue.errdescription!="")
    {
	    alert(serverData);
	    return;
    }
   
    if(returnValue.fileurl!="")
    {
	    __showFileUploaded(file,returnValue.fileurl);
    }
}

function __showFileUploaded(file,__filePath)
{
    
    $("#PicPath"+boundUploadElement).val(__filePath);

    
    $('#dialogupload').dialog('close');
    __renderViewPic();
}

function __upload(s)
{
    boundUploadElement=s;
    gE("iframeupload").contentWindow.document.location.replace("uploadfile.aspx");
    $("table.uploadtable").hide();
    $("#uploadtable"+s).show();
    __showdialog("图片上传");
}

function __removepic(s)
{
    $("#PicPath"+s).val("");
    __renderViewPic();
}

function __renderViewPic()
{
    var i;

    for (i=1;i<=2;i++)
    {
        if($("#PicPath"+i).val()!="")
        {
            $("#APicPath"+i).attr("target","_blank");
            $("#APicPath"+i).attr("href",$("#PicPath"+i).val());
            var _t=$("#PicPath"+i).val().split("/");
            $("#APicPath"+i).html("查看已上传文件 >> "+_t[_t.length-1]);
            $("#viewpic"+i).show();
        }
        else
        {
            $("#APicPath"+i).html("");
            $("#viewpic"+i).hide();
        }
    }
}

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <form name="f1" id="f1" method="post" enctype="multipart/form-data" onsubmit="javascript:return __checkform(event);">
        <table border="0" cellspacing="0" cellpadding="0" align="center" class="formtable">
            <tr>
                <td class="WebNote_Field">信息分类</td>
                <td><select size="1" name="NoteTypeID" id="NoteTypeID" nullabled="false" alerttext="信息分类"></select>
                    <a href="javascript:setCookie('NoteTypeID',document.getElementById('NoteTypeID').value);alert('记忆成功'+getCookie('NoteTypeID'));">记住当前分类</a>
                </td>
            </tr>
            <tr>
                <td class="WebNote_Field">信息标题</td>
                <td><input type="text" name="NoteTitle" id="NoteTitle" size="90" class="InputText" maxlength="255" datatype="string" nullabled="false" alerttext="信息标题" autocomplete="off" />
                    <span class="divHelp">(必填项，255个字符以内)</span>
                </td>
            </tr>
            <tr>
                <td class="WebNote_Field">meta_keyword<br>(关键词)
                </td>
                <td><input type="text" name="meta_keyword" id="meta_keyword" size="90" class="InputText" maxlength="255" datatype="string" nullabled="true" alerttext="关键词" autocomplete="off" />
                    <span class="divHelp">(255个字符以内)</span>
                </td>
            </tr>
            <tr>
                <td class="WebNote_Field">meta_description<br>(纯文字描述)
                </td>
                <td><input type="text" name="meta_description" id="meta_description" size="90" class="InputText" maxlength="255" datatype="string" nullabled="true" alerttext="纯文字描述" autocomplete="off" />
                <span class="divHelp">(255个字符以内)</span>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align:center">
                  <div class="divHelp">以下为信息正文内容编辑器，请注意编辑器中是否出现横向滚动条。如果出现横向滚动条，那么前台页面对应的显示区域可能会被撑开。</div>
                  <br />
                  <cc1:Editor ID="editor" runat="server" EditorPath="/webnoteeditorV3/" MenuBar="True" skin="extjs"/>
                </td>
            </tr>
            <tr>
                <td class="WebNote_Field">
                    信息附图1(列表附图)
                </td>
                <td>
                    <input type="button" value="上传" style="margin-left: 2px; height: 22px; font-size: 8pt;" onclick="javascript:__upload('1');" /><span class="divHelp">只能上传<%=core.setting.get("uploadallowmaxfilesize").ToString()%>K以下大小的图片</span>
                    <span class="viewpic" id="viewpic1"><a id="APicPath1" class="btnViewPic"></a><span onclick="javascript:__removepic(1)"></span></span>
                    <input type="hidden" id="PicPath1" name="PicPath1" />
                </td>
            </tr>
            <tr>
                <td class="WebNote_Field">
                    信息附图2
                </td>
                <td>
                    <input type="button" value="上传" style="margin-left: 2px; height: 22px; font-size: 8pt;" onclick="javascript:__upload('2');" /><span class="divHelp">只能上传<%=core.setting.get("uploadallowmaxfilesize").ToString()%>K以下大小的图片</span>
                    <span class="viewpic" id="viewpic2"><a id="APicPath2" class="btnViewPic"></a><span onclick="javascript:__removepic(2)"></span></span>
                    <input type="hidden" id="PicPath2" name="PicPath2" />
                </td>
            </tr>
            <tr>
                <td class="WebNote_Field">排序号
                </td>
                <td>
                    <input type="text" name="SortNum" id="SortNum" maxlength="255" datatype="number" nullabled="true" alerttext="排序号" autocomplete="off" />
                    <span class="divHelp">排序号：按从小到大，从上到下的顺序显示记录。</span>
                </td>
            </tr>
            <tr>
                <td class="WebNote_Field">发布日期</td>
                <td>
                    <input maxlength="30" size="20" name="ModifyTime" id="ModifyTime" class="inputSelectDate" readonly />
                    <span class="divHelp">不填写，则以当前时间作为发布日期。</span>
                </td>
            </tr>
            <tr flag="3">
                <td class="WebNote_Field">调用编号</td>
                <td>
                    <input maxlength="30" size="20" name="EditID" id="EditID">
                    <span class="divHelp">此处由网站技术开发员填写。</span>
                </td>
            </tr>
        </table>

        
        <input type="hidden" name="noteid" id="noteid" />
        <input type="hidden" name="Mode" />
        <input type="hidden" name="Content" id="Content" />
        <input type="hidden" name="urlhref" id="urlhref" />
        <div class="submitbuttons">
            <input type="submit" value="提交" id="btnSubmit" class="btn" disable="disabled" />
        </div>
    </form>
    
    <div id="dialogupload" class="X-dialog">
        <iframe src="" id="iframeupload" frameborder="0" style="width:100%;height:260px"></iframe>
	</div>

</asp:Content>

